#include <iostream>

int main(int argc, char const *argv[])
{
    using namespace std;

    // 1. Get the memeory of the array and its elements
    int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8};

    cout << "size of the array is " << sizeof(arr) << endl;
    cout << "element of the array is " << sizeof(arr[0]) << endl;
    cout << "the length of the elements in the array is " << sizeof(arr) / sizeof(arr[0]) << endl;

    // 2. Get the head address of the array in memory
    cout << "the head address is " << (long)arr << endl;
    cout << "the address of the first element is " << (long)&arr[0] << endl;
    cout << "the address of the second element is " << (long)&arr[1] << endl;

    cout << "(long)&arr[1] - (long)&arr[0] = " << (long)&arr[1] - (long)&arr[0] << endl;
    return 0;
}
